<template>
  <div style="height:100%;width:100%">
    <el-row class="mainContent" >
      <!--工具条-->
      <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
        <el-form :inline="true"  :model="filters" size="small" style="text-align:left;" ref="filters">
          <el-form-item >
            <!--<el-input v-model="filters.keyword" placeholder="手机号" clearable></el-input>-->
          </el-form-item>
          <el-form-item >
            <el-input v-model="filters.serialnumber" placeholder="流水号" clearable></el-input>
          </el-form-item>
          <el-form-item>
            <el-select v-model="filters.state" placeholder="状态" clearable>
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-select v-model="filters.orgin" placeholder="提现方式" clearable>
              <el-option
                v-for="item in optionss"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
              <el-date-picker
                v-model="filters.begtime"
                type="datetime"
                placeholder="申请开始日期">
              </el-date-picker>
          </el-form-item>
          <el-form-item>
              <el-date-picker
                v-model="filters.endtime"
                type="datetime"
                placeholder="申请结束日期">
              </el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary"  @click="getUsers">查询</el-button>
          </el-form-item>
        </el-form>
      </el-col>
      <!--列表-->
      <el-table :data="users" highlight-current-row v-loading="listLoading" style="width: 100%;">
        <el-table-column label="流水号" prop="serialnumber">
        </el-table-column>
        <el-table-column prop="mobile" label="手机号"  >
        </el-table-column>
        <el-table-column prop="realname" label="实名"  >
        </el-table-column>
        <el-table-column prop="applyTime" label="申请时间"  >
        </el-table-column>
        <el-table-column prop="payTime" label="处理时间"  >
        </el-table-column>
        <el-table-column prop="amount" label="申请金额"  >
        </el-table-column>
        <el-table-column prop="bankCardbranch" label="银行"  >
        </el-table-column>
        <el-table-column prop="bankCardNo" label="银行卡号"  >
        </el-table-column>
        <el-table-column label="提现方式"  >
          <template slot-scope="scope">
            {{scope.row.orgin | orginFormat}}
          </template>
        </el-table-column>
        <el-table-column prop="adminUsercode" label="操作员"  >
        </el-table-column>
        <el-table-column  label="状态"  >
          <template slot-scope="scope">
            {{scope.row.state | stateFormat}}
          </template>
        </el-table-column>
      </el-table>
      <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="limit"
                     :total="total" style="float:right;">
      </el-pagination>
    </el-row>
  </div>

</template>
<script>
  export default {
    data() {
      return {
        options: [
//          {
//          value: '10',
//          label: '未处理'
//        },
          {
          value: '15',
          label: '已处理'
        }, {
          value: '20',
          label: '已拒绝'
        }],
        optionss: [{
          value: '5',
          label: '连连支付'
        }, {
          value: '10',
          label: '线下转账'
        }],
        filters:{
          begtime:'',
          endtime:''
        },
        listLoading:false,
        limit:10,
        page:1,
        total:0,
        users:[]
      };
    },
    filters:{
      stateFormat(val){
        switch (val){
          case 10:
            return '未处理';
            break
          case 15:
            return '已处理';
            break
          case 20:
            return '拒绝';
            break
        }
      },
      orginFormat(val){
        switch (val){
          case 10:
            return '线下转账';
            break
          case 5:
            return '连连支付';
            break
        }
      },
    },
    created() {
      this.getUsers()
    },
    methods: {
      getUsers(){
        this.users = []
        this.listLoading = true;
        var obj = {
          data:{
            keyword:this.filters.keyword,
            serialnumber:this.filters.serialnumber,
            state:this.filters.state,
            orgin:this.filters.orgin,
            applyBegtime:this.filters.begtime==''||this.filters.begtime==0||this.filters.begtime==null?' ':Math.round(new Date(this.filters.begtime).getTime()/1000),
            applyEndtime:this.filters.endtime==''||this.filters.endtime==0||this.filters.endtime==null?' ':Math.round(new Date(this.filters.endtime).getTime()/1000),
            pageNo:this.page,
            orderCol:"payTime"
          }

        };
        this.$http('sys/membercash/list.do',obj).then(resp => {
          if(resp.code==1){
            this.users = resp.data.list;
            this.total = resp.data.total;
          }
          this.listLoading = false;
        });
      },
      handleCurrentChange(val) {
        this.page = val;
        this.getUsers();
      },

    }
  }
</script>

<style scoped>

</style>
